package com.haiyan.demo01_面向对象;

public class test {
    public static void main(String[] args) {
        int[] arr={10,20,30,40,50};
        for(int i=0;i<arr.length;i++)
        {
            if(i==arr.length-1)
            {
                System.out.println(arr[i]+"]");
            }
            else if(i==0)
            {
                System.out.print("["+arr[i]+",");
            }
            else{
                System.out.print(arr[i]+",");
            }
        }
    }
}
